Works now correctly