fixing issues with code