Fixed issue with variables in wrong order