I see no glaring errors, but without seeing the rest of the code there's really no way for us to tell. C.f. my close vote: This site is about
specific problems and how to solve them. We're not where you post to check that your code is OK (that's Code Review, another site in the SE network). If you go there, please post something complete that can actually be meaningfully reviewed. —
HTNW 34 secs ago