Fixed getCourse not working sometimes throwing an error in backend php.