Made it compatible with JavaFx 8