Fixed bugs with course retrival