it works, but not in proper way