Trying to find and fix bug