fixing a bug added 3 lines