made it work properly