made this multiplatform and put platform logic here
made this multiplatform and put platform logic here