Added some checking around rawinput