not working logic