fixed deprecated method call
restored functionality for Redmine 2.5.1
* refactored towards conventions
removed deprecation warning
fixed brace mismatch