Moved some line of code

Moved some lines of code
tested apps

tested apps