Everything works but has strange bug