fixed little bug to work correctly