Fixed the bug (previously done in the Javacode)